<#import "/spring.ftl" as spring/>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">

    <title>支付</title>

    <link rel="stylesheet" href="<@spring.url '/css/qrcode-redirect.css'/>"/>

    <script>
        <#if showConfirmPage>
            function pay() {
                location.href = '${codeUrl}';
            }
        <#else>
            location.href = '${codeUrl}';
        </#if>
    </script>
</head>

<body>
<#if showConfirmPage>
    <div class="content-bg"></div>
    <div class="content header">
        <span><img src="<@spring.url '/images/shield.png'/>" alt="checked"/></span>
        ${title}
    </div>
    <div class="content flat-top">
        <div class="field-group">
            <div class="field-name" style="padding-top: 0.675rem">需支付金额</div>
            <div class="field-value"><span id="price" class="price">${amount?string('0.00')}</span>元</div>
        </div>
        <div class="field-group">
            <div class="field-name">订单金额</div>
            <div class="field-value"><span id="order-price" class="order-price">${amount?string('0.00')}</span>元</div>
        </div>
        <div class="field-group">
            <div class="field-name">收款商户</div>
            <div class="field-value">${merchantName}</div>
        </div>

        <div class="field-group last" style="text-align: center">
            <a href="#" class="btn" onclick="pay()">立即支付</a>
        </div>
    </div>
<#else>
    <h2 style="text-align: center; margin-top: 2rem;">支付中...</h2>
</#if>
</body>
</html>